<template>
    <div class="filterSelect">
      <span class="filterSelect-label">租户名称</span>
      <el-select
        v-model="currentValue"
        placeholder="请选择租户"
        class="z-h-100"
        filterable
        @change="changeFun"
        size="mini"
        :style="{width:width+'px'}"
      >
      <el-option
          v-for="item in typeOptions"
          :key="item.value"
          :value="item.value"
          :label="item.label"
          :disabled="!isSelectAble"
      ></el-option>
    </el-select>
    </div>
</template>

<script>
import { mapGetters } from "vuex";
import userMixins from "./userMixins";
export default {
  name: "filterSelect",
  props: {
    width: {
      type: [String, Number],
      default: 200
    }
  },
  data() {
    return {
      form: {}
    };
  },
  mixins: [userMixins],
  // data () {
  //   return {
  //     currentValue: "09111392aec4f930211c8cb501ac3f97"
  //   };
  // },
  computed: {
    ...mapGetters(["typeOptions", "user"]),
    isSelectAble () {

      return this.user.code === "1";
    }
  },
  methods: {
    changeFun () {
      console.log(this.currentValue);
      this.$emit("change", this.currentValue);
    }
  }
};
</script>

<style lang="less" scoped>
.filterSelect{
  display:flex;
  align-items: center;
  .filterSelect-label{
    width: 80px;
    font-size: 14px;
    color:#606266;
    text-align: center;
  }
}
</style>

